package com.goingup.domain;

/**
 * Represents a trip made by a passenger.
 * @author pcresswell
 *
 */
public class PassengerTrip {
	private Floor startingFloor;
	private Floor destinationFloor;
	
	private Passenger passenger;
	private long startingTime;
	private long endingTime;
	
	public Floor getStartingFloor() {
		return startingFloor;
	}
	public void setStartingFloor(Floor startingFloor) {
		this.startingFloor = startingFloor;
	}
	public Floor getDestinationFloor() {
		return destinationFloor;
	}
	public void setDestinationFloor(Floor destinationFloor) {
		this.destinationFloor = destinationFloor;
	}
	public long getTripTimeInMilliseconds() {
		return endingTime- startingTime;
	}
	
	public Passenger getPassenger() {
		return passenger;
	}
	public void setPassenger(Passenger passenger) {
		this.passenger = passenger;
	}
	public void startClock() {
		startingTime = System.currentTimeMillis();
	}
	public void stopClock(){
		endingTime = System.currentTimeMillis();
		System.out.print("Trip took: " + this.getTripTimeInMilliseconds() + "\n");
	}
	public long tripTime(){
		return endingTime - startingTime;
	}
	
}
